import xadmin

from .models import Movie,MovieParticulars,MovieResourse

class MovieAdmin(object):
    list_display = ['name','fav_nums','click_nums','add_time']
    search_fields = ['name','fav_nums','click_nums']
    list_filter = ['name','fav_nums','click_nums','add_time']



class MovieParticularsAdmin(object):
    list_display = ['name','image','movie_type','director','protagonist','region','language','release_data','intro','add_time']
    search_fields = ['name__name','image','movie_type','director','protagonist','region','language','release_data','intro']
    list_filter = ['name','image','movie_type','director','protagonist','region','language','release_data','intro','add_time']


class MovieResourseAdmin(object):
    list_display = ['name','download','add_time']
    search_fields = ['name','download']
    list_filter = ['name','download','add_time']


xadmin.site.register(Movie,MovieAdmin)
xadmin.site.register(MovieParticulars,MovieParticularsAdmin)
xadmin.site.register(MovieResourse,MovieResourseAdmin)
